﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WF_ExportTool.Configuration.Tree
{
    /// <summary>
    /// 树工具主表
    /// </summary>
    public class Tree_Main : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int TreeId { get; set; }
        /// <summary>
        /// 树编号
        /// </summary>
        public string TreeCode { get; set; }
        public int AutoIndex { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string TreeTitle { get; set; }
        /// <summary>
        /// 所属子系统
        /// </summary>
        public int SysId { get; set; }
        /// <summary>
        /// 所属业务功能
        /// </summary>
        public string FuncTitle { get; set; }
        public Boolean IsControlByRight { get; set; }
        public string RoleNames { get; set; }
        public string RoleIds { get; set; }
        public string UserNames { get; set; }
        public string UserIds { get; set; }
        public string DepNames { get; set; }
        public string DepIds { get; set; }
        /// <summary>
        /// 显示模式
        /// </summary>
        public int ShowType { get; set; }
        /// <summary>
        /// 左侧树占用宽度，单位像素
        /// </summary>
        public int LeftTreeWidth { get; set; }
        /// <summary>
        /// 扩展JS
        /// </summary>
        public string JSEx { get; set; }
        /// <summary>
        /// 数据加载模式(注意：如果需要通过JS局部刷新树节点时，请选择逐级加载模式)
        /// </summary>
        public int DataLoadType { get; set; }
        /// <summary>
        /// 是否显示复选框
        /// </summary>
        public Boolean IsShowCheckBox { get; set; }
        /// <summary>
        /// Checkbox默认选中，支持表达式，多个值之间用，分隔
        /// </summary>
        public string ChkDefaultSelValue { get; set; }
        /// <summary>
        /// 是否级联选择子节点
        /// </summary>
        public Boolean IsSelectChild { get; set; }
        /// <summary>
        /// 是否可以拖拽
        /// </summary>
        public Boolean IsCanDrag { get; set; }
        /// <summary>
        /// 选中事件执行方法，方法不允许传递参数
        /// </summary>
        public string SelectEventMethod { get; set; }
        /// <summary>
        /// 双击事件执行方法，方法不允许传递参数:
        /// </summary>
        public string DoubleClickEventMethod { get; set; }
        /// <summary>
        /// 加载完成后执行方法，方法不允许传递参数:
        /// </summary>
        public string OnLoadEventMethod { get; set; }
        /// <summary>
        /// 右击事件执行方法，方法不允许传递参数:
        /// </summary>
        public string RightClickEventMethod { get; set; }


    }
    /// <summary>
    /// 树节点详情
    /// </summary>
    public class Tree_DataSource : BaseEntity {
        /// <summary>
        /// 主键
        /// </summary>
        public int SourceId { get; set; }
        /// <summary>
        /// 外键
        /// </summary>
        public int TreeId { get; set; }
        /// <summary>
        /// 父级树节点编号
        /// </summary>
        public int ParentSourceId { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string DataTitle { get; set; }
        /// <summary>
        /// 数据库链接实例
        /// </summary>
        public string DbIns { get; set; }
        /// <summary>
        /// 数据源SQL
        /// </summary>
        public string DataSource { get; set; }
        /// <summary>
        /// 是否递归读取数据
        /// </summary>
        public Boolean SourceIsRecursion { get; set; }
        /// <summary>
        /// 节点标题，支持表达式
        /// </summary>
        public string NodeTitle { get; set; }
        /// <summary>
        /// 节点扩展属性，支持表达式
        /// </summary>
        public string NodeAttrEx { get; set; }
        /// <summary>
        /// 节点图标(双击选择)
        /// </summary>
        public string NodeIcon { get; set; }
        /// <summary>
        /// 数据表名(拖拽和删除功能用)
        /// </summary>
        public string MainTableName { get; set; }
        /// <summary>
        /// 表主键字段，只支持单主键(拖拽和删除功能用)
        /// </summary>
        public string PKField { get; set; }
        /// <summary>
        /// 存储父级ID的字段名(拖拽和删除功能用)
        /// </summary>
        public string ParentIdField { get; set; }
        /// <summary>
        /// Checkbox根据哪个字段默认选中，配置字段名
        /// </summary>
        public string ChkSelFieldName { get; set; }
    }
    /// <summary>
    /// 功能维护
    /// </summary>
    public class Tree_Func : BaseEntity {
        /// <summary>
        /// 主键
        /// </summary>
        public int FuncId { get; set; }
        /// <summary>
        /// 外键
        /// </summary>
        public int TreeId { get; set; }
        /// <summary>
        /// 功能标题
        /// </summary>
        public string FuncTitle { get; set; }
        /// <summary>
        /// 功能图标(双击选择)
        /// </summary>
        public string FuncIcon { get; set; }
        /// <summary>
        /// 显示顺序
        /// </summary>
        public int ShowOrder { get; set; }
        /// <summary>
        /// 执行JS方法
        /// </summary>
        public string JSMethod { get; set; }
        public int ShowPosition { get; set; }
        /// <summary>
        /// 关联数据源，选择具体数据源，则只在这个数据源里出现
        /// </summary>
        public int SourceId { get; set; }
        /// <summary>
        /// 是否启用根据条件来判断按钮是否显示
        /// </summary>
        public Boolean IsUseExpressionShow { get; set; }
        /// <summary>
        /// 用来比较是否显示的原值表达式
        /// </summary>
        public string LeftExpression { get; set; }
        /// <summary>
        /// 比较方法
        /// </summary>
        public int ShowMethod { get; set; }
        /// <summary>
        /// 用来比较是否显示的目标值表达式
        /// </summary>
        public string RightExpression { get; set; }
        /// <summary>
        /// 条件为真时是否显示
        /// </summary>
        public Boolean IsShowByExpression { get; set; }
    }
}
